<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算器练习</title>
</head>
<body>
<input type="text" id="i1">
<hr>
<input type="text" id="i2">
<hr>
<button onclick="sum()">加</button>
<button onclick="f2()">减</button>
<button onclick="f3()">乘</button>
<button onclick="f4()">除</button>
<h3>运算结果:<span id="result"></span></h3>
<script>
    function sum(){
        let inputE = document.getElementById('i1');
        let inputE2 = document.getElementById('i2');
        let result = parseInt(inputE.value) + parseInt(inputE2.value);
        document.getElementById('result').innerText = result;
    }
</script>
</body>
</html>